import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  PromotionAddEverydayCensusVO,
  PromotionAddEverydayCensusForm,
  PromotionAddEverydayCensusQuery
} from '@/api/oce/promotionAddEverydayCensus/types';

/**
 * 查询广告每日新增数量统计列表
 * @param query
 * @returns {*}
 */

export const listPromotionAddEverydayCensus = (query?: PromotionAddEverydayCensusQuery): AxiosPromise<PromotionAddEverydayCensusVO[]> => {
  return request({
    url: '/oce/promotionAddEverydayCensus/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询广告每日新增数量统计详细
 * @param promotionAddCensusId
 */
export const getPromotionAddEverydayCensus = (promotionAddCensusId: string | number): AxiosPromise<PromotionAddEverydayCensusVO> => {
  return request({
    url: '/oce/promotionAddEverydayCensus/' + promotionAddCensusId,
    method: 'get'
  });
};

/**
 * 新增广告每日新增数量统计
 * @param data
 */
export const addPromotionAddEverydayCensus = (data: PromotionAddEverydayCensusForm) => {
  return request({
    url: '/oce/promotionAddEverydayCensus',
    method: 'post',
    data: data
  });
};

/**
 * 修改广告每日新增数量统计
 * @param data
 */
export const updatePromotionAddEverydayCensus = (data: PromotionAddEverydayCensusForm) => {
  return request({
    url: '/oce/promotionAddEverydayCensus',
    method: 'put',
    data: data
  });
};

/**
 * 删除广告每日新增数量统计
 * @param promotionAddCensusId
 */
export const delPromotionAddEverydayCensus = (promotionAddCensusId: string | number | Array<string | number>) => {
  return request({
    url: '/oce/promotionAddEverydayCensus/' + promotionAddCensusId,
    method: 'delete'
  });
};
